<div class="page-header">
    <h3 class="remove-line-height">Welcome <?php echo $authuser['fname'].' '.$authuser['mname'].' '.$authuser['lname']?> !</h3>
</div>

<div style="padding: 20px; margin-bottom: 50px;">
    <i class="icon icon-question-sign icon-3x pull-left"></i>
    <p>Welcome to your student payments Dashboard. With this portal you will be able to make payments for various services on the platform</p>
</div>

<h3>Notifications</h3>
<?php
//debug($notifications);
if($notifications){
    foreach($notifications as $notify){
        $id = $notify['StudentNotification']['id'];
        $title = $notify['StudentNotification']['notify_title'];
        $msg = $notify['StudentNotification']['notify_msg'];
        echo "<div class='notify-wrapper' data-id=$id>".$this->Message->msg($title,$msg,'success', true)."</div>";
    }
    if($authuser['first_time_pass_changed'] == 'No'){
        echo $this->Message->msg('Important','Please Change your password!','warning', false);
    }
}
else{
    if($authuser['first_time_pass_changed'] == 'No'){
        echo $this->Message->msg('Important','Please Change your password!','error', false);
    }
    else{
        echo $this->Message->msg('Notification','You have no notifications','warning', true);
    }
}
?>
<input type="hidden" id="delete_notification" value="<?php echo $this->Html->url(array('controller' => 'Student', 'action' => 'deleteNotification')); ?>" />

<script type="text/javascript">
    $("div.notify-wrapper > div.alert > a").click(function(){
        var id = $(this).parent().parent().attr('data-id');
        var url = $('#delete_notification').val()+'/'+id;
        var query = '';
        $.post(url, query, function (response) {

        },'json');
       //alert(id);
    });
</script>